

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>发布新计划</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport"
		  content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" href="layuiadmin/layui/css/layui.css" media="all">
	<link rel="stylesheet" href="layuiadmin/style/admin.css" media="all">
	<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
	<style type="text/css">
		.sousuo {
			margin-left: 900px
		}
	</style>
	<script type="text/javascript" src="layuiadmin/layui/layui.all.js"></script>
	<link href="layuiadmin/layui/css/layui.css" rel="stylesheet" type="text/css" />
	<!-- <link rel="stylesheet" href="${pageContext.request.contextPath}/css/layui/css/layui.css" rel="external nofollow" >
    <script src="${pageContext.request.contextPath}/js/layui.js" ></script> -->
</head>
<body>
<form class="layui-form" action="">
	<div class="layui-form-item">
		<div class="layui-card-header"
			 style="text-align: center; padding-top: 10px">

			<div class="layui-input-inline">
				<input type="text" class="layui-input" id="otype"
					   placeholder="请输入单号">
			</div>
			<div class="layui-input-inline">
				<input type="text" class="layui-input" id="laydate-type-month"
					   placeholder="时间区间">
			</div>
			<div class="layui-input-inline">
				<div class="layui-input-block" style="width: 250px;">
					<select name="interest" lay-filter="aihao">
						<option value="">请选择状态</option>
						<option value="0">临时保存</option>
						<option value="1">审批中</option>
						<option value="2">报价中</option>
						<option value="3">提货中</option>
						<option value="4">跟单报价</option>
					</select>
				</div>
			</div>
			<button class="layui-btn layui-btn-lg" data-type="reload"
					onclick="SearchTime()" style="margin-left: 30px">搜索</button>
		</div>
	</div>
	<div class="layui-tab-item layui-show">
		<table class="layui-hide" id="table-WZD" lay-filter="table-WZD"></table>
	</div>
</form>

<script src="layuiadmin/layui/layui.js"></script>
<script typetype="text/javascript"></script>
<!-- 新增 -->
<script>
	layui.config({
		base: 'layuiadmin/' //静态资源所在路径
	}).extend({
		index: 'lib/index' //主入口模块
	}).use(['index', 'table','upload', 'form'], function(){
		var table = layui.table;
		table.render({
			elem: '#table-WZD'
			,url: 'http://localhost:8086/selectPingZheng'
			,limits:[3]
			, limit: 3 //每页默认显示的数量
			, page: true
			,cols:
					[
						[
							,{field:'vENDORCODE', title:'商户', width:120, align:'center'}
							,{field:'vENDORNAME', title:'编码', align:'center'}
							,{field:'rEGISTEREDAREA', title:'ID', width: 150, align:'center'}
							,{field:'pHONE', title:'ID', width: 150, align:'center'}
							,{field:'aDDRESS', title:'名字', width: 150, align:'center'}
							,{field:'dDLD', title:'电话',width: 150, align:'center'}
							,{field:'eNABLEDFLAG', title:'地区',width: 150, align:'center'}
						]
					]
		});
//监听行单击事件（双击事件为：rowDouble）
		table.on('rowDouble(table-WZD)', function(obj){
            var data = obj.data;
            //将localStorage传递到哪个页面
            location:href = 'new/updateOrder.html';
            //设置localStorage
            window:localStorage.setItem('obj',JSON.stringify(data));
			layer.open({
				type: 2,
				title: "详细信息",
				area: ['600px', '480px'],
				skin: 'layui-layer-rim',
				content: ['http://localhost:8086/page?url=new/updateOrder.html', 'no']
			});
		//事件监听获取选中的复选框的值
		table.on('checkbox(table-WZD)', function() {
			var checkStatus = table.checkStatus('table-WZD');
			console.log("选中的值1!!");
			console.log(checkStatus.data)//选中行数据
		})
		$("#Ts").click(function() {
			var index = parent.layer.getFrameIndex(window.name);
			var checkStatus = table.checkStatus('table-WZD');//获取选中的值
			console.log("选中的值");
			// console.log(checkStatus.data);
			var paramJson3 = JSON.stringify(checkStatus.data)
			console.log(paramJson3);
			$.ajax({
				url : 'http://localhost:8086/insertPingZheng',
				type : 'post',
				data : paramJson3,
				dataType : 'json',
				contentType : 'application/json; charset=utf-8',
				success : function(paramJson3) {
					alert(paramJson3.msg);
					location.reload();
				}
			});
		});
		});
	});
</script>
</body>
</html>